package com.minimalist.basic.entity.po;

import com.minimalist.basic.config.mybatis.InsertFullColumnHandler;
import com.minimalist.basic.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.basic.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import lombok.*;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 操作日志表 实体类。
 *
 * @author 11987
 * @since 2025-01-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "M_OPERATOR_LOG", onInsert = InsertFullColumnHandler.class
        , onUpdate = UpdateFullColumnHandler.class)
public class MOperatorLog extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 操作日志ID
     */
    private Long operatorLogId;

    /**
     * 执行方法名称
     */
    private String name;

    /**
     * 请求URI
     */
    private String uri;

    /**
     * 请求方式
     */
    private String method;

    /**
     * 用户代理
     */
    private String userAgent;

    /**
     * 请求IP
     */
    private String ip;

    /**
     * 请求参数
     */
    private String params;

    /**
     * 请求时间
     */
    private LocalDateTime requestTime;

    /**
     * 请求时长(ms)
     */
    private String exceedTime;

    /**
     * 执行结果
     */
    private String result;

    /**
     * 状态  0：失败   1：成功
     */
    private Integer status;

    @Column(tenantId = true)
    private Long tenantId;

}
